<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS 的三种使用方式</title>
</head>

<body>
    <p onclick="javascript:alert('Hello!');">这是一段文字。</p>
    <script>
        const b = 32;
        const c = 32;
        var message = 'a这是来自变量的信息';
        console.log(message, b);
        console.log(message + b);
        console.log(b + c);
        if (b == c) {
            console.log('相等');
        } else {
            console.log('不相等');
        }
        var category = 'true';
        switch (category) {
            // debugger
            case 'rumor':
                console.log('这是一个谣言');
                break;
            case 'true':
                console.log('确有此事');
                break;
            default:
                break;
        }
        for (let index = 0; index <= 9; index++) {
            console.log(index);
        }
        var i = 0;
        while (i == 0) {
            console.log(i);
            // i++;
        }

        function say(message) {
            console.log(message);
        }
        say('hello');
        say('bye');

        function score(url) {
            // 根据学生的仓库地址，获取仓库推送日期，计算出按时提交作业的次数，最后根据次数，给出平时成绩。
            return 90;
        }
        console.log(score());
        var d = 'true';
        var e = true;
        console.log(d, e, typeof d, typeof e);
        var f;
        console.log(f, typeof f);
        console.log(b, typeof b);
        console.log(typeof c.toString());
        console.log(message.toUpperCase());
        d = '2';
        console.log(typeof Boolean(d), Boolean(d));

    </script>
    <!-- <script src="demo.js"></script> -->

</body>

</html>
